import https from "./http";
import {config} from "./apiConfig";
// 获取表字段
export const apiCommon = process.env.NODE_ENV == "development" ? "/zdUrl" : `${config.ip}/docker-service/`;

// 获取戒毒案例
export function getCaseInfo(params, config = {}) {
  return https({
    url: `${apiCommon}/CaseInfo/TableInfo`,
    method: 'get',
    headers: {
      sendKey: "getCaseInfo"
    },
    params,
    ...config
  })
}

// 新增戒毒案例
export function addCaseInfo(params, config = {}) {
  return https({
    url: `${apiCommon}/CaseInfo/addTable`,
    method: 'get',
    headers: {
      sendKey: "addCaseInfo"
    },
    params,
    ...config
  })
}

// 更新戒毒案例
export function updateCaseInfo(params, config = {}) {
  return https({
    url: `${apiCommon}/CaseInfo/updateTable`,
    method: 'get',
    headers: {
      sendKey: "updateCaseInfo"
    },
    params,
    ...config
  })
}


// 删除戒毒案例
export function delCaseInfo(params, config = {}) {
  return https({
    url: `${apiCommon}/CaseInfo/delTable`,
    method: 'get',
    headers: {
      sendKey: "delCaseInfo"
    },
    params,
    ...config
  })
}

// 导入excel
export function importExcel(params, config = {}) {
  return https({
    url: `${apiCommon}/CaseInfo/importExcel`,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    data: params,
    ...config
  })
}



